import request from '@/utils/request'
import { yuanToFen } from '@/utils/unitUtil'

// 查询单价列表
export function listUnitPrice(query) {
  return request({
    url: '/consumer/unitPrice/list',
    method: 'get',
    params: query
  })
}

// 查询单价详细
export function getUnitPrice(unitId) {
  return request({
    url: '/consumer/unitPrice/' + unitId,
    method: 'get'
  })
}

// 新增单价
export function addUnitPrice(data) {
  return request({
    url: '/consumer/unitPrice',
    method: 'post',
    data: data
  })
}

// 修改单价
export function updateUnitPrice(data) {
  return request({
    url: '/consumer/unitPrice',
    method: 'put',
    data: data
  })
}

// 删除单价
export function delUnitPrice(unitId) {
  return request({
    url: '/consumer/unitPrice/' + unitId,
    method: 'delete'
  })
}
